import { reactive, ref } from 'vue'
import type { Home } from '@/TS/Hooks/Home/Home'
import * as $http from '@/utlis/interface/home'
import { tfOrder } from '@/utlis/interface/orderDlatils'
import { runErrandReceviedGoods, runErrandsdelivered } from "@/utlis/interface/orderDlatils"
import { forDate, forSeconds } from '@/utlis/time'
import { changeTitleText, runErrandTitleText } from '@/utlis/setStatusText'
import { riderLoaction, useStore } from '@/Pinia/index'
import { GetDistance, getLocation, GPS, NavTo, getToPhone } from '@/utlis/uni_api'

// #ifdef APP-PLUS
import { soundPlay } from '@/utlis/uni_api'
// #endif

import { onLoad, onUnload ,onShow} from "@dcloudio/uni-app";
import { riderLocationCache } from "@/Pinia";


interface baseDataShow {
	MeShow: boolean,
	SkipModel: boolean,
	Meswitch: boolean | null,
	sendCode: boolean,
	colorShow: boolean
	RefreshShow: boolean
	codeTextShow: boolean
}

interface pickCdoeDta {
	orderId: string | number,
	pickCode: any,
	riderDo: number | null
}

interface tipText {
	codeText: any,
	titleText: any
}

// #ifdef APP-PLUS
const fUN_AmapLocation = uni.requireNativePlugin('FUN-AmapLocation');
// #endif

export default (proxy: any) => {
	const orderlist = reactive<any>({
		list: [],
		list_show: true
	}) //订单列表
	const takeOutGoodsType = reactive<Home.takeOutGoodsType>({
		pageNo: 1,
		pageSize: 10,
		distributionType: 0,   // 0外卖  1 跑腿
		statusType: 0, // 订单状态  0 新任务  1   待接单   2配送中
		riderLongitude: 114.27707144208377,
		riderLatitude: 35.75041512369788,
		origins: '',
	})
	// 消息
	const infoList=ref(false)
	// 弹出层控制
	const baseDataShow = reactive<baseDataShow>({
		MeShow: false,
		SkipModel: false,
		Meswitch: null,
		sendCode: false,
		colorShow: false,
		RefreshShow: false,
		codeTextShow: false
	})
	const tipText = reactive<tipText>({
		titleText: null,
		codeText: null,

	})
	// 跑腿订单取货码
	const takeGoodInfo = reactive<pickCdoeDta>({
		orderId: '',
		pickCode: null,
		riderDo: null
	})
	//回调设置取货码赋值
	const changeOrderCode = (e: any) => {
		takeGoodInfo.pickCode = e
		if (e.length >= 6) {
			baseDataShow.colorShow = true


		} else {
			baseDataShow.colorShow = false
			baseDataShow.codeTextShow = false
		}

	}
	//  外面0  跑腿1     默认1
	const changeType = reactive({ Type: 1 })
	const Tabs = reactive<Home.Tabs>({
		list: [
			{
				name: `新任务`,
				key: 0,
				value: null
			},
			{
				name: '待取货',
				key: 1,
				value: null

			},
			{
				name: '配送中',
				key: 2,
				value: null

			},
			{
				name: '消息',
				key: 3,
				value: null
			
			},
		], current: 0
	})

	let lastLatitude: number | undefined = 0
	let lastLongitude: number | undefined = 0
	const loactionData = reactive({
		startingLongitude: null,
		startingLatitude: null,
	})
	let timer: any = null
	let timer13: any = null
	let isRefresh = false
	const locationCacheObj = riderLocationCache();
	onLoad(async () => {
		let accessToken = uni.getStorageSync('Authorization')
		//判断是否登录
		if (!accessToken) {
			uni.redirectTo({
				url: '/pages/Login/Login',
			})
			return
		}

		// #ifdef APP
		// 获取手机通话权限 放到onshow中会重复触发onshow不知道因为什么  放到这个里面吧
		getToPhone().then(res => {
			uni.setStorageSync('getToPhone', res)
		})
		// #endif

		getUserInfoRequest()
		//onLocationChangeListener()
		getOrderCount();
		getinfoCount()

		firstLocation();
		
		timer = setInterval(() => {
			isRefresh = true
			//console.log("5秒------")
			changeListDis();
		}, 5000)
		await takeOutGoods();

		timer13 = setInterval(() => {
			isRefresh = true
			//console.log("13秒------")
			firstLocation()
		}, 13000)

		// #ifdef APP-PLUS
		await keepAlive(accessToken);
		// #endif
	})
	onLoad(async () => {
		takeOutGoodsType.pageNo = 1
		orderlist.list = []
			await takeOutGoods();
	})

	onUnload(() => {
		//onLocationCancelChangeListener()
		//clearInterval(timer)
		clearInterval(timer13)
	});

	/**
	 * 位置发生变化的监听回调
	 */
	const onLocationChangeListener = () => {
		//开启接收位置更新
		uni.startLocationUpdate({
			success: res => {
				console.log('开启接收位置消息成功' + JSON.stringify(res))
				//监听位置变化
				uni.onLocationChange(function (res) {
					// console.log("onLocationChange = res.latitude =" + res.latitude + ", lastLatitude = " + lastLatitude + ",res.longitude =" + res.longitude + ",lastLongitude =" + lastLongitude)
					//位置不一致则表示发生变化
					if (isRefresh && (lastLatitude != res.latitude || lastLongitude != res.longitude)) {
						console.log('更新位置 ---纬度：' + res.latitude + '，经度：' + res.longitude);
						uni.setStorageSync('riderLongitude', res.longitude)
						uni.setStorageSync('riderLatitude', res.latitude)
						//重新设置当前位置
						takeOutGoodsType.riderLatitude = res.latitude + ""
						takeOutGoodsType.riderLongitude = res.longitude + ""

						//最新骑手位置
						let newLocation = {
							startingLongitude: res.longitude,
							startingLatitude: res.latitude,
							type: 'listener'
						}
						//向服务器更新骑手位置
						loactionStatus.updateRiderLoaction(newLocation)
						isRefresh = false
					}
					//更新经纬度，位置监听回调判断使用
					lastLatitude = res.latitude
					lastLongitude = res.longitude
				});
			},
			fail: err => {
				proxy.$API(proxy).Toast("开启接收位置消息失败", 'error')
				console.error('开启接收位置消息失败：', err)
			},
		});
	}

	//取消变化位置监听
	const onLocationCancelChangeListener = () => {
		//关闭时卸载位置更新监听
		uni.stopLocationUpdate({
			success: (res: any) => {
				console.log('关闭接收位置消息成功' + JSON.stringify(res))
			},
			fail: (err: any) => {
				console.error('关闭接收位置消息失败：', err)
			},
		});
	}

	//查询个人信息
	const getUserInfoRequest = () => {
		nowstatus.setStatus(proxy).then(async (res) => {
			baseDataShow.SkipModel = nowstatus.infoData.moduleShow;
			nowstatus.infoData.userWorkStatus == 0 ? (baseDataShow.Meswitch = false) : (baseDataShow.Meswitch = true);
		});
	}

	// 列表 滑块
	const TabsClick = (item: any) => {
		if(item.index==3){
			infoList.value=true
		}else{
			infoList.value=false
		}
		console.log(infoList.value);
		Tabs.current = item.index
		console.log("跑腿 item.index = " + item.index)
		takeOutGoodsType.statusType = Tabs.list[item.index].key
		takeOutGoodsType.pageNo = 1
		orderlist.list_show = true
		orderlist.list = []
		if (nowstatus.infoData.userWorkStatus == 1) return
		getOrderCount()
		takeOutGoods()
		getinfoCount()
	}

	// 上线下线状态改变
	const nowstatus = useStore()
	// 实名认证跳转
	const confirmSkipModel = () => {
		NavTo('/pages/Wode/certification')
	}

	//获取订单列表
	const takeOutGoods = () => {

		if (orderlist.list_show && nowstatus.infoData.userWorkStatus == 1) return

		let lat1 = takeOutGoodsType.riderLatitude
		let lon1 = takeOutGoodsType.riderLongitude


		switch (changeType.Type) {
			case 0://外卖
				$http.takeOutGoods(takeOutGoodsType, proxy).then((res: any) => {
					//console.log("定位:" + JSON.stringify(takeOutGoodsType));
					if (res.data.length != 0 && orderlist.list_show) {
						res.data?.forEach((item: any, index: any) => {
							//外卖
							console.log(333, item);
  uni.setStorageSync('userMobile', item.userMobile)
							if (item.orderType == 0) {
								let obj = {
									GoodsTypeShow: true,
									price: item.price,
									orderGoodsShow: forSeconds(item.expireTime) >= 0 ? true : false,
									expireTime: forSeconds(item.expireTime), // 订单失效时间
									id: item.id,
									remark: item.remark, //  备注
									merchantMobile: item.merchantMobile, //  商家电话
									userMobile: item.userMobile, //用户手机号
									name: item.name, //商户名称
									payTime: item.payTime, // 下单时间
									pickAddress: item.pickAddress, //取货地址
									receiveAddress: item.receiveAddress, // 收货地址
									riderToUserDistance: item.riderToUserDistance, //骑手到用户距离
									riderToMerchantDistance: item.riderToMerchantDistance, //骑手到商家距离
									riderClientStatus: item.riderClientStatus,
									riderPhone: item.riderPhone,
									statusText: changeTitleText(item.riderClientStatus),
									Btntitle: '抢单',
									orderSn:item.orderSn,
									BtnSaveTitle: changeTitleText(item.riderClientStatus),
									merchantClientStatus: item.merchantClientStatus,
									btn_disable: true,
									result: item.result,
									dayNum: item.dayNum,
									predictTime: item.predictTime,
									startTime: item.startTime,
									startTimeOver: item.startTime + 900000,
									startingLatitude: item.startingLatitude,
									startingLongitude: item.startingLongitude,
									terminalLatitude: item.terminalLatitude,
									terminalLongitude: item.terminalLongitude,
									pickName: item.pickName,
									pickPhone: item.pickPhone,
									goodsVOS: item.goodsVOS,
									phone: item.phone,
									orderType: item.orderType,
									merchantName: item.merchantName,
									sfBuy: 0,
									isIm: item.isIm,
									status: getOrderStatus(item.status),
									statusShow: getOrderStatusShow(item.status),
									orderStatusOri: item.status
								}

								try {
									if (typeof lat1 === "number" && typeof lon1 === "number") {
										if (Tabs.current == 1) {
											obj.riderToMerchantDistance = GetDistance(lat1, lon1, item.startingLatitude, item.startingLongitude)
										} else if (Tabs.current == 2) {
											obj.riderToUserDistance = GetDistance(lat1, lon1, item.terminalLatitude, item.terminalLongitude);
										} else {
											obj.riderToMerchantDistance = GetDistance(lat1, lon1, item.startingLatitude, item.startingLongitude);
											obj.riderToUserDistance = GetDistance(lat1, lon1, item.terminalLatitude, item.terminalLongitude);
										}
									}
								} catch (e) {
									console.log(e)
								}
								const exists = orderlist.list.some(existingItem => existingItem.id === item.id);
								if (!exists) {
									orderlist.list.push(obj);
								}


							}
							//跑腿
							else {
								let obj = {
									articleWeight: item.articleWeight,
									currentStatus: item.currentStatus,
									id: item.id,
									pickAddress: item.pickAddress,
									riderToUserDistance: item.receiveAddressDistance == '' ? '0' : item.receiveAddressDistance,
									pickName: item.pickName,
									pickPhone: item.pickPhone,
									predictTime: item.predictTime,
									price: item.price,
									receiveAddress: item.receiveAddress,
									riderToMerchantDistance: item.pickAddressDistance == '' ? '0' : item.pickAddressDistance,
									riderPhone: item.riderPhone,
									receiveName: item.receiveName,
									receivePhone: item.receivePhone,
									remark: item.remark,
									riderClientStatus: item.riderClientStatus,
									riderDo: item.riderDo,
									startingLatitude: item.startingLatitude,
									startingLongitude: item.startingLongitude,
									terminalLatitude: item.terminalLatitude,
									terminalLongitude: item.terminalLongitude,
									taskTypeShow: true,  //  订单帮我买 / 帮我送
									Btntitle: '抢单',
									isIm: item.isIm,
									sfBuy: item.sfBuy,
									orderType: item.orderType,
									BtnSaveTitle: runErrandTitleText(item.currentStatus),
									statusText: runErrandTitleText(item.currentStatus),
									merchantName: item.merchantName,
									startTime: item.startTime,
									createTime: item.createTime,
									status: getOrderStatus(item.status),
									statusShow: getOrderStatusShow(item.status),
									orderStatusOri: item.status
								}

								const exists = orderlist.list.some(existingItem => existingItem.id === item.id);
								if (!exists) {
									orderlist.list.push(obj);
								}
							}
						})
					} else {
						orderlist.list_show = false
					}
				}).catch((err) => {
					orderlist.list_show = false
				})
				break

			default:
				changeType.Type = 0
		}

	}

	// 设置取消订单应显示的状态
	const getOrderStatus = (type: any) => {
		let text = ""
		switch (type) {
			case -1:
				text = "已取消"
				break;
			case 3:
				text = "退款申请"
				break;
			case 4:
				text = "退款中"
				break;
			case 5:
				text = "已退款"
				break;
		}
		return text
	}

	// 获取订单状态是否应该显示
	const getOrderStatusShow = (type: any) => {
		let show: any = ""
		switch (type) {
			case -1:
				show = true
				break;
			case 3:
				show = true
				break;
			case 4:
				show = true
				break;
			case 5:
				show = true
				break;
			default:
				show = false
		}
		return show
	}
	// 获取新消息
	
const getinfoCount = () => {
	$http.infoCount(proxy).then(async (res: any) => {
		
		let isNew = res.data
		
				
		if (isNew) {
		
			// console.log("存在新消息",res.data)
		  // #ifdef APP-PLUS
		  await soundPlay(9);
		  // #endif
		}  
	})
}
	const loactionStatus = riderLoaction()
	// 获取不同类型订单数量
	const getOrderCount = () => {
		orderlist.list = []
		$http.orderCount(proxy).then((res: any) => {
			if (res.code == 0) {
				//外卖
				if (changeType.Type == 0) {
					Tabs.list[0].name = `新任务(${res.data.takeOutNewTask > 99 ? '99+' : res.data.takeOutNewTask})`
					Tabs.list[1].name = `待取货(${res.data.takeOutWaitPickup > 99 ? '99+' : res.data.takeOutWaitPickup})`
					Tabs.list[2].name = `配送中(${res.data.takeOutdelivery > 99 ? '99+' : res.data.takeOutdelivery})`
					Tabs.list[3].name = `消息(${res.data.unreadMessageNum > 99 ? '99+' : res.data.unreadMessageNum})`
				}
				//跑腿
				else if (changeType.Type == 1) {
					Tabs.list[0].name = `新任务(${res.data.runNewTask > 99 ? '99+' : res.data.runNewTask})`
					Tabs.list[1].name = `待取货(${res.data.runWaitPickup > 99 ? '99+' : res.data.runWaitPickup})`
					Tabs.list[2].name = `配送中(${res.data.runDelivery > 99 ? '99+' : res.data.runDelivery})`
					Tabs.list[3].name = `消息(${res.data.unreadMessageNum > 99 ? '99+' : res.data.unreadMessageNum})`
				}
			}
		})
	}

	//下拉加载
	const toLower = (e: any) => {
		if (nowstatus.infoData.userWorkStatus == 1) return
		if (orderlist.list_show) {
			takeOutGoodsType.pageNo++;
			takeOutGoods()
		} else {
			proxy.$API(proxy).Toast('暂无更多数据', 'warning')
		}
	}

	// 类型切换
	let crowIndex = ref<any>(0)
	const SwitchType = (index: number) => {

		Tabs.list[0].name = '新任务'
		Tabs.list[1].name = '待取货'
		Tabs.list[2].name = '配送中'
		takeOutGoodsType.distributionType = index
		crowIndex.value = index
		changeType.Type = index
		orderlist.list_show = true
		orderlist.list = []
		getOrderCount()
		takeOutGoods()
		getinfoCount()
	}

	// 按钮重置列表
	const resetmakeOrder = () => {
		Tabs.list[0].name = '新任务'
		Tabs.list[1].name = '待取货'
		Tabs.list[2].name = '配送中'
		takeOutGoodsType.pageNo = 1
		orderlist.list = []
		orderlist.list_show = true


		getinfoCount()
		getOrderCount()
		takeOutGoods()


	}

	// 个人信息弹出层 switch 滑动重置列表
	const switchReset = () => {
		takeOutGoodsType.pageNo = 1
		orderlist.list = []
		orderlist.list_show = true
		nowstatus.infoData.userWorkStatus === 1 ? baseDataShow.RefreshShow = true : baseDataShow.RefreshShow = false
		Tabs.list[0].name = '新任务'
		Tabs.list[1].name = '待取货'
		Tabs.list[2].name = '配送中'
		takeOutGoods()
		getOrderCount()
	}

	const switchTypelist = reactive<any>([{ name: '外卖' }, { name: '跑腿' }])
	// 外卖抢单
	const GrabanOrder = (id: any) => {
		$http.robOrder({ id }, proxy)
			.then((res) => {
				takeOutGoods()
			})
			.catch((err) => {
			})
	}

	//刷新列表
	const loadList = () => {
		orderlist.list_show = true
		if (nowstatus.infoData.userWorkStatus == 0) {
			takeOutGoodsType.pageNo = 1
			orderlist.list = []
			getOrderCount()
			takeOutGoods()
			getinfoCount()
		}
	}

	//实名验证模态框弹出
	const setSkipModel = () => {
		//baseDataShow.SkipModel = true
	}

	const setSkipModel2 = () => {
		baseDataShow.SkipModel = true
	}

	//跑腿订单子传父验证码赋值
	const setSendCodeModel = (e: any) => {
		console.log(222, takeOutGoodsType.statusType);
		// tipText.codeText = '请输入正确的取货码'




		if (takeOutGoodsType.statusType == 1) {

			tipText.titleText = '确定取件吗'
			baseDataShow.sendCode = true
			takeGoodInfo.orderId = e.id
			takeGoodInfo.riderDo = e.riderDo
		} else {

			tipText.titleText = '确定收货吗'
			takeGoodInfo.orderId = e.id
			takeGoodInfo.riderDo = e.riderDo
			baseDataShow.sendCode = true
		}
	}

	// 取消

	const cancelSendCode = () => {
		baseDataShow.sendCode = false
		baseDataShow.codeTextShow = false

	}

	//确认发送验证码
	const confirmSendCode = () => {
		console.log(111, takeOutGoodsType.statusType, baseDataShow.colorShow);

		let data = {
			orderId: takeGoodInfo.orderId,
			// pickCode: takeGoodInfo.pickCode,
			// riderLongitude: "114.270812",
			// riderLatitude: "35.704091",
			riderLongitude: uni.getStorageSync('riderLongitude'),
			riderLatitude: uni.getStorageSync('riderLatitude'),
		}
		if (takeOutGoodsType.statusType == 1) {


			runErrandReceviedGoods(data, proxy).then((res: any) => {
				if (res.code == 0) {
					proxy.$API(proxy).Toast(res.msg, 'success')
					setTimeout(() => {
						TabsClick({ index: 2 })
						// resetmakeOrder()
						baseDataShow.sendCode = false

						//待取货
					}, 1000)
				}
			}).catch((err: any) => {
				tipText.codeText = err.msg
				baseDataShow.codeTextShow = true
			})
		} else if (takeOutGoodsType.statusType == 2) {
			let Data = {
				orderId: takeGoodInfo.orderId,
				receiveCode: takeGoodInfo.pickCode,
				riderLongitude: uni.getStorageSync('riderLongitude'),
				riderLatitude: uni.getStorageSync('riderLatitude'),
				// riderLongitude: "114.270812",
				// riderLatitude: "35.704091",
			}

			runErrandsdelivered(Data, proxy).then((res: any) => {
				if (res.code == 0) {
					console.log(111, res);
					proxy.$API(proxy).Toast(res.msg, 'success')
					setTimeout(() => {
						baseDataShow.sendCode = false
						tipText.codeText = `请输入正确的${tipText.titleText}`
						resetmakeOrder()
					}, 1000)
				}
			}).catch((err: any) => {
				tipText.codeText = err.msg
				baseDataShow.codeTextShow = true
			})
		} else {
			baseDataShow.codeTextShow = true
		}
	}

	/**
	 * 打开首次同步骑手位置
	 */
	const firstLocation = () => {
		//console.log("首次打开同步骑手位置")
		getLocation().then((response: any) => {
			//console.log("response: " + JSON.stringify(response));
			if (response.latitude && response.longitude) {
				let gcj = GPS.gcj_encrypt(response.latitude, response.longitude);
				//更新
				takeOutGoodsType.riderLongitude = gcj.lon
				takeOutGoodsType.riderLatitude = gcj.lat
				//缓存定位
				locationCacheObj.locationCacheObj.lon = gcj.lon
				locationCacheObj.locationCacheObj.lat = gcj.lat
				//最新骑手位置
				let newLocation = {
					startingLongitude: gcj.lon,
					startingLatitude: gcj.lat,
					type: 'time'
				}
				//向服务器更新骑手位置
				loactionStatus.updateRiderLoaction(newLocation)
			}
		})
			.catch(err => {
				console.log(err)
			})
	}

	const keepAlive = async (accessToken: any) => {
		if (plus.os.name == 'Android') {
			await fUN_AmapLocation.start(
				{
					intervalTime: 5000,
					reportInterval: 5,
					isReport: false,
					url: 'https://api.waimaishi.cn/app-api/riderLocationRecord/getRiderLocationRecord',
					params: { time: 5, Authorization: accessToken },
					headers: { Authorization: accessToken },
					notificationTitle: "外卖狮骑手",
					notificationText: "外卖狮骑手后台运行中",
					isWifiActiveScan: true,
					gpsFirst: false,
					apikey: "8044c96210279230199b20fd4defb06a"//高德key,配置不生效,需这里配置
				},
				function (result: any) {
					//见下方定位返回示例
					// console.log('====fUN_AmapLocation定位====', JSON.stringify(result));
				}
			);
		}
	}

	let num = 0;
	const changeListDis = () => {
		
		//缓存定位
		let lat1 = locationCacheObj.locationCacheObj.lat
		let lon1 = locationCacheObj.locationCacheObj.lon
		if (lat1 == 0) {
			return
		}
		
		orderlist.list?.forEach((item: any, index: any) => {
			if (Tabs.current == 1) {
				item.riderToMerchantDistance = GetDistance(lat1, lon1, item.startingLatitude, item.startingLongitude);
			} else if (Tabs.current == 2) {
				item.riderToUserDistance = GetDistance(lat1, lon1, item.terminalLatitude, item.terminalLongitude);
			} else {
				item.riderToMerchantDistance = GetDistance(lat1, lon1, item.startingLatitude, item.startingLongitude);
				item.riderToUserDistance = GetDistance(lat1, lon1, item.terminalLatitude, item.terminalLongitude);
			}
		})
	}

	// 转单
	const orderId = ref('')
	const isShow = ref(false)
	const clickIsShow = (id: any) => {


		orderId.value = id;
		isShow.value = true
	}

	// 关闭退款弹出框
	const isShowFalse = () => {
		isShow.value = false
	}

	const clickConfirm = (remark: string) => {
		if (remark.trim() == '') {
			isShowFalse()
			proxy.$API(proxy).Toast('转单原因不能为空', 'error')
			return
		}

		getTfOrder(remark)
		isShowFalse()
	}

	const getTfOrder = (msg: any) => {
		let par = {
			orderId: orderId.value,
			msg: msg
		}

		tfOrder(par, proxy).then(res => {
			proxy.$API(proxy).Toast('转单成功', 'success')
			loadList()
		})
	}

	const radiolist = ref([{
		name: '订单不顺路',
		disabled: false
	},
	{
		name: '暂时不能配送',
		disabled: false
	},
	{
		name: '距离当前位置较远',
		disabled: false
	},
	{
		name: '其他',
		disabled: false
	},
	])


	// 电话联系弹出层
	const phoneBtnList = ref({
		arr: [],
		type: '',
		orderId: '',
		riderPhone: ""
	})
	
	const phoneListShow = ref(false)
	const getPhoneList = (obj: any) => {
	
		// 如果订单未完成可以联系收货人取货人
		// 订单成功不能联系  直接隐藏
		if (obj.type == 4) {
			return proxy.$API(proxy).Toast('订单已完成不能联系用户', 'error')
		}
		
	    uni.setStorageSync('phoneBtnList', JSON.stringify(obj))
		
		phoneBtnList.value = { ...JSON.parse(uni.getStorageSync('phoneBtnList')) }
	
		phoneListShow.value = true
	}
	const btnCancel = () => {
		phoneListShow.value = false
	}


	return {
		Tabs,
		TabsClick,
		baseDataShow,
		takeOutGoodsType,
		takeOutGoods,
		SwitchType,
		orderlist,
		GrabanOrder,
		switchTypelist,
		crowIndex,
		changeType,
		getOrderCount,
		loadList,
		// checkLoactionRole,
		nowstatus,
		resetmakeOrder,
		switchReset,
		toLower,
		confirmSkipModel,
		confirmSendCode,
		setSkipModel,
		setSendCodeModel,
		takeGoodInfo,
		changeOrderCode,
		// timerRefresh,
		tipText,
		cancelSendCode,
		firstLocation,
		isShow,
		orderId,
		radiolist,
		clickConfirm,
		isShowFalse,
		clickIsShow,
		getPhoneList,
		phoneBtnList,
		btnCancel,
		phoneListShow,
		setSkipModel2,
		infoList
	}
}